import os, sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from lList import DCLinkList

def Is_sym(L):
    first = L.dhead.next
    end = L.dhead.prior
    for i in range(L.getSize()//2):#it is not good to use L.getSize()
        if first.data != end.data:
            return "no"
        first = first.next
        end = end.prior
    return "yes" 

if __name__ == "__main__":
    A = DCLinkList()
    A.CreateListR([1, 2, 3, 4, 3, 2, 1, 0])
    B = DCLinkList()
    B.CreateListR([1, 2, 3, 3, 2, 1])
    print(Is_sym(A))
    print(Is_sym(B))